/*           Copyright(c) 2007-2008 Dave Sexton            *
 *                   XmlTreeView Control                   *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.XPath;

namespace DaveSexton.Controls
{
	public interface IXmlTreeViewDataManager
	{
		bool BindToDataSourceChildren { get; }

		IXPathNavigable DataSource { get; set; }

		void Update();

		void InitializeTreeNode(XmlTreeNode node, IXPathNavigable element);

		bool ShouldCheckRecursive(XmlTreeNode node, IXPathNavigable element);

		void CheckElement(XmlTreeNode node, IXPathNavigable element, bool check);

		bool CanEditElement(XmlTreeNode node, IXPathNavigable element);

		void SetElementLabel(XmlTreeNode node, IXPathNavigable element, string label);
		
		bool CanMoveElement(XmlTreeNode node, IXPathNavigable element);

		bool CanContainElement(XmlTreeNode node, IXPathNavigable element, XmlTreeNode parent, IXPathNavigable parentElement);

		bool CanDeleteElement(XmlTreeNode node, IXPathNavigable element);

		bool ShouldDeleteRecursive(XmlTreeNode node, IXPathNavigable element);

		bool DeleteElement(XmlTreeNode node, IXPathNavigable element);

		IXPathNavigable InsertNewChild(IXPathNavigable element, string name);

		IXPathNavigable InsertElementBefore(IXPathNavigable sourceElement, IXPathNavigable targetElement);

		IXPathNavigable InsertElementAfter(IXPathNavigable sourceElement, IXPathNavigable targetElement);

		IXPathNavigable InsertElementFirstChild(IXPathNavigable sourceElement, IXPathNavigable targetElement);

		IXPathNavigable InsertElementLastChild(IXPathNavigable sourceElement, IXPathNavigable targetElement);

		event EventHandler DataSourceChanged;

		event EventHandler<ElementChangedEventArgs> ElementChanged;
	}
}
